﻿var termManager = {};
termManager.url = "Action.ashx";
termManager.getList = function (taxonomy, callbackFun, pageIndex) {
    var form = {};
    form.pi = pageIndex == undefined || null ? 1 : pageIndex;
    form["action"] = taxonomy == 1 ? "5" : "11";
    $.post(termManager.url, form, callbackFun, "json");
}
termManager.getCateList = function (callbackFun, pageIndex) {
    return termManager.getList(1, callbackFun, pageIndex);
}
termManager.getTagList = function (callbackFun, pageIndex) {
    return termManager.getList(2, callbackFun, pageIndex);
}
termManager.remove = function (termId) {
    if (confirm("删除后将无法恢复，确定彻底删除吗？")) {
        var form = {};
        form.action = "17";
        form.termId = termId;
        $.post(termManager.url, form, function (jsonData) {
            if (jsonData.success) {
                alert("操作成功");
                jDoc.reload();
            } else {
                alert("操作失败");
            }
        }, "json");
    }
}
